package merchantCard

import (
	wxcard "github.com/chanxuehong/wechat/mp/card"
)

const MAX_MEMBERCARD_LEVEL = 10 //最大等级数
type MchCardUnionMsg struct {
    wxcard.CardMsg
	MchCardMsg
    CardParaTemplateId int `json:"card_para_template_id"`
}

type MchCardMsg struct {
	MchCardStru `json:"mch_card"`
}
type MchCardStru struct {
	CardMode CARDMODE `json:"card_mode" xorm:"card_mode"`
	MchMemberCard *MchMemberCardAttr `json:"mch_member_card"`
}

func NewMchCardUnionMsg(cardType string) *MchCardUnionMsg{
	if cardType != wxcard.CardTypeMemberCard {
		return nil
	}
	CardUnion := new(MchCardUnionMsg)

	if cardType == wxcard.CardTypeMemberCard {
		CardUnion.MchMemberCard = new(MchMemberCardAttr)
		CardUnion.MchMemberCard.MemberLevelConf = make([]*MemberLevelConf, MAX_MEMBERCARD_LEVEL)

		//CardUnion.Card.MemberCard = new(wxcard.MemberCard)
	}




    return CardUnion
}